import { Controller, Body, Post, Query, Get } from '@nestjs/common';
import { CommitService } from './commit.service';

@Controller('commit')
export class CommitController {
  constructor(private readonly commitService: CommitService) {}

  //保存评论
  @Post('/save')
  async saveCommit(@Body() body: any) {
    return this.commitService.saveCommit(body);
  }

  //修改评论
  @Post('/update')
  async updateCommit(@Body() body: any) {
    return this.commitService.updateCommit(body);
  }

  //获取评论
  @Get('/get')
  async getCommit(@Query() query: any) {
    return this.commitService.getCommit(query);
  }

  //上传配置
  @Post('/config')
  async uploadConfig(@Body() body: any) {
    return this.commitService.uploadConfig(body);
  }

  //获取配置
  @Get('/config')
  async getConfig(@Query() query: any) {
    return this.commitService.getConfig(query);
  }

  //上传LOG
  @Post('/log')
  async uploadLog(@Body() body: any) {
    return this.commitService.uploadLog(body);
  }

  //获取LOG
  @Get('/log')
  async getLog() {
    return this.commitService.getLog();
  }

  //上传帮助信息
  @Post('/help')
  async uploadHelp(@Body() body: any) {
    console.log(body);
    
    return this.commitService.uploadHelp(body);
  }

  //获取帮助信息
  @Get('/help')
  async getHelp() {
    return this.commitService.getHelp();
  }
}
